package kr.hkit.powerjava.alone.vo;

import java.io.Serializable;

public class Account implements Serializable, Comparable<Account> {

	private static final long serialVersionUID = 6199264042657220041L;

	private int accountNo;
	private String accountPw;
	private int balance;

	public Account(int accountNo, String accountPw) {
		this.accountNo = accountNo;
		this.accountPw = accountPw;
	}

	public Account(int accountNo, String accountPw, int balance) {
		this.accountNo = accountNo;
		this.accountPw = accountPw;
		this.balance = balance;
	}

	@Override
	public int compareTo(Account o) {
		return accountNo - o.accountNo;
	}

	@Override
	public boolean equals(Object obj) {
		boolean result = false;
		if (obj instanceof Account) {
			Account temp = (Account) obj;
			result = (accountNo == temp.accountNo && accountPw
					.equals(temp.accountPw));
		}
		return result;
	}

	@Override
	public String toString() {
		return "Account [accountNo=" + accountNo + ", balance=" + balance + "]";
	}

	public int getAccountNo() {
		return accountNo;
	}

	public void setAccountNo(int accountNo) {
		this.accountNo = accountNo;
	}

	public String getAccountPw() {
		return accountPw;
	}

	public void setAccountPw(String accountPw) {
		this.accountPw = accountPw;
	}

	public int getBalance() {
		return balance;
	}

	public void setBalance(int balance) {
		this.balance = balance;
	}

}
